package com.aplink.dellcommercial.activities;

import android.content.IntentFilter;
import android.os.Bundle;

import com.aplink.dellcommercial.fragments.LoginFragment;
import com.aplink.dellcommercial.network.NetworkConnectivityReceiver;
import com.aplink.generic.GenericActivity;
import com.aplink.generic.GenericFragment;

public class LoginActivity extends GenericActivity {
    private NetworkConnectivityReceiver mNetworkConnectivityReceiver;

    @Override
    protected GenericFragment getFragment() {
        return new LoginFragment();
    }

    @Override
    protected void onCreate( Bundle savedInstanceState ) {
        super.onCreate( savedInstanceState );
        mNetworkConnectivityReceiver = new NetworkConnectivityReceiver();
    }

    @Override
    protected void onResume() {
        super.onResume();
        IntentFilter intentFilter = new IntentFilter(
                android.net.ConnectivityManager.CONNECTIVITY_ACTION );
        registerReceiver( mNetworkConnectivityReceiver, intentFilter );
    }

    @Override
    protected void onPause() {
        super.onPause();
        unregisterReceiver( mNetworkConnectivityReceiver );
    }
}
